<?php
my_component_load('testing' , false);
my_component_load('paging' , false);  
my_component_load('data_setting', false);	
my_component_load('pendidikan' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$modulname = "Admin _BN_ Konfigurasi Data";
if($_SERVER['REQUEST_METHOD'] == "POST" ):
	$validatepost = form_pendidikan_validate($id);
	switch($task){
		case   "pendidikancreate" :
			if($validatepost){
				$errors = message_multi_error($validatepost);
				$content = $errors;
				$content .= form_pendidikan_create($id);
				generate_my_web($content,"","plain.php");
				exit; 
			}else{
				form_pendidikan_submit($id);
				$content =  "Updated";
				generate_my_web($content,"","plain.php");
				exit;
			}
		break;
		case   "jabatancreate" :
			form_jabatan_submit();
			$content =  "Updated";
			generate_my_web($content,"","plain.php");
			exit;
		break;
	}

else: 	
	if($task == "editpendidikan"){
		$title= ($id > '0' ) ?  "Perubahan data pendidikan" : "Tambah data pendidikan";
		facebox_page('index.php?com=pendidikan&task=pendidikancreate&id='.$id , $title , 280	); 
	}elseif($task == "pendidikancreate"){ 
		$content  = form_pendidikan_create($id);
		generate_my_web($content,"","plain.php");
		exit; 
	}elseif($task == 'delete'){ // DELETE ITEM	
		remove_pendidikan($id);
		my_direct('index.php?com=pendidikan');
	}else{
		$pagename = "Daftar pendidikan";
		load_facebox_script();
		$view =  list_pendidikan(); 
		
	}
endif;  
$content = spliter_browser( $view , $pagename ,'index.php?com=pendidikan&task=editpendidikan');
generate_my_web($content, $modulname." _BN_ Pendidikan" );
?>